gpsbabel.git
4 years agoadd support for cmake build options (#809)
tsteven4 [Tue, 4 Jan 2022 20:19:56 +0000 (13:19 -0700)]
add support for cmake build options (#809)

* add initial support for cmake build options.

including basic library configuration.
Unlike our qmake build it generates and links with static libraries if
we are using our internally supplied copies.  The configuration options
are not as sophisticated as in our qmake build.  The configuration of
zlib will likely be acceptable as cmake provides support via findZLIB.
The configuration of shapelib and libusb-1.0 likely will likely need to
be enhanced.

* fix typo

* mimic qmake library searches.

too much energy went into verification with packagers that the
qmake options were sufficient for their needs.

* tweak library searches

4 years agoadd intial support for CTest (#808)
tsteven4 [Mon, 3 Jan 2022 15:57:07 +0000 (08:57 -0700)]
add intial support for CTest (#808)

* add CTest tests.

* add note about improvements for ctest.

* running xmlwf and utf8bom tests is appropriate for single tests.

4 years agouse hierarchy with cmake. (#807)
tsteven4 [Sun, 2 Jan 2022 23:51:03 +0000 (16:51 -0700)]
use hierarchy with cmake. (#807)

* use hierarchy with cmake.

* adjust cmake test script for hierarchy.

the default target with cmake builds both the CLI and the GUI.
alternatively, "cmake --build . --target gpsbabel" to build just the
CLI or "cmake --build . --target GPSBabelFE|gpsbabelfe to build just
the GUI.

* detect attempts to generate a build system from a subdirectory.

* fix shellcheck issues.

4 years agomake gbversion.h, setup.iss generated files. (#806)
tsteven4 [Sun, 2 Jan 2022 19:22:11 +0000 (12:22 -0700)]
make gbversion.h, setup.iss generated files. (#806)

* make gbversion.h, setup.iss generated files.

add cmake documentation targets.

* work on check.

* simplify parameter passing to test scripts.

* cmake test work.

run vtesto in parallel.
fix valgrind decision making in testo.
fix test for gpsbabel executable with blanks in path.

* update vtesto for cmake.

* simplify option passing for testo.

* simplify valgrind detection in testo.

* fix testo bug.

* add ubuntu cmake build.

* fix workflow

* align gui pro and CMakeLists.

and use target properties

4 years agofix bad merge in mtk_logger. (#805)
tsteven4 [Thu, 30 Dec 2021 01:35:18 +0000 (18:35 -0700)]
fix bad merge in mtk_logger. (#805)

1. Jan 01, 2017 269c55eb5 Robert fixes ftruncate issue.
2. Jan 23, 2017 604178aa8 HarelM fixes same a different way.
3. Jan 25, 2017 8456d1d21 Robert merges resulting in duplicate fixes.

I am backing out HarelM's fix.

4 years agoEliminate internal_styles.cc completely (#804)
tsteven4 [Wed, 29 Dec 2021 14:48:33 +0000 (07:48 -0700)]
Eliminate internal_styles.cc completely (#804)

* Eliminate internal_styles.cc entirely.

* add missing qrc file.

* fix resource compilation with ninja.

* fix potential detach.

* kill empty statement

* update qrc file formatting with QtCreator resource editor.

4 years agomigrate from directory level cmake commands to target commands. (#802)
tsteven4 [Mon, 27 Dec 2021 13:36:27 +0000 (06:36 -0700)]
migrate from directory level cmake commands to target commands. (#802)

* migrate from directory level cmake commands to target commands.

fix a few bugs with our CMakeLists:

set WIN32 for gui target.  remove _CONSOLE, it's obsolete.

when undefining UNICODE, also undefine _UNICODE.  it's not clear to
me we have a sensitivity to UNICODE/_UNICODE.

take optimization flags out of CMakeLists, rely on CMAKE_BUILD_TYPE
to select appropriate flags.

don't force ZLIB_INHIBITED to be undefined on windows.

add cmake support for some of our configuration options:
disable-mappreview, embed_map, embed_translations.

* fix duplicated code in gui/CMakeLists.txt

* spelling fix for INSTALL.

4 years agoSpelling fix in doc.
Robert Lipe [Sun, 26 Dec 2021 05:10:47 +0000 (00:10 -0500)]
Spelling fix in doc.

4 years agoMerge branch 'master' of https://github.com/gpsbabel/gpsbabel
Robert Lipe [Sun, 26 Dec 2021 05:08:26 +0000 (00:08 -0500)]
Merge branch 'master' of https://github.com/gpsbabel/gpsbabel

4 years agoSpelling fix in interpolate: positve -> positive
Robert Lipe [Sun, 26 Dec 2021 05:07:49 +0000 (00:07 -0500)]
Spelling fix in interpolate: positve -> positive

4 years agotake out some trash. (#799)
tsteven4 [Fri, 17 Dec 2021 21:42:11 +0000 (14:42 -0700)]
take out some trash. (#799)

old configure scripts.
mingw stuff.

4 years agoremove misleading, dangerous and unneeded redefinitions (#798)
tsteven4 [Thu, 16 Dec 2021 23:15:18 +0000 (16:15 -0700)]
remove misleading, dangerous and unneeded redefinitions (#798)

for snprintf, vsnprintf.

delete an unneeded MSVC compiler pragma.

4 years agoretire is_fatal for better static analysis (#797)
tsteven4 [Thu, 16 Dec 2021 22:00:12 +0000 (15:00 -0700)]
retire is_fatal for better static analysis (#797)

* join is_fatal lines in prep for transformation.

1,$g/is_fatal.*[^;]$/j

* replace is_fatal with if() fatal().

this allows better static analysis.

sed -i '1,$s/^\( *\)is_fatal *( *\(.*\), *MYNAME\([^;]*\);$/\1if (\2) {\n\1  fatal(MYNAME\3;\n\1}/' $file
sed -i '1,$s/^\( *\)is_fatal *( *\(.*\), *"\([^;]*\);$/\1if (\2) {\n\1  fatal("\3;\n\1}/' $file

* manual delete extra parenthesis.

4 years agoPossible unterminated string in humminbird (#794)
GPSBabel [Thu, 16 Dec 2021 04:48:03 +0000 (23:48 -0500)]
Possible unterminated string in humminbird (#794)

Leave space for null terminator when copying string into fixed-size buffer.

4 years agoDeprecate navicache (#793)
Robert Lipe [Thu, 16 Dec 2021 03:22:37 +0000 (22:22 -0500)]
Deprecate navicache (#793)

* Deprecate navicache.

4 years agouse streams for garmin_fit debug messages. (#795)
tsteven4 [Wed, 15 Dec 2021 23:56:05 +0000 (16:56 -0700)]
use streams for garmin_fit debug messages. (#795)

* use streams for garmin_fit debug messages.

This eliminates the Qt 6 warnings related to the change in types
for container sizes and the format specifier.

* retire debug_print()

* make logging debug single arg ctors explicit

4 years agoretire some csv char based routines. (#790)
tsteven4 [Mon, 13 Dec 2021 16:27:55 +0000 (09:27 -0700)]
retire some csv char based routines. (#790)

* retire some csv char based routines.

The last csv_lineparse user, garmin_txt, is converted to csv_linesplit.

xcsv_parse_val converted to use csv_stringtrim(QString,QString,int),
eliminating the other overloads.

xcsv_parse_style_line parsing of FIELD_DELIMITER, FIELD_ENCLOSER,
RECORD_DELIMITER and BADCHARS updated to use the above overload of
csv_stringtrim.  FIELD_DELIMITER, FIELD_ENCLOSER and RECORD_DELIMITER
changed to trim, with a double quote enclosure,  before character substitution.
There was a subtle bug in csvs_stringtrim(char, char, int).  When trimming
a source that was all white space the first white space character would
be retained, while others would be trimmed.  This did occur with CRNEWLINE,
but the bug allowed other substitutions to work, e.g. SPACE, NEWLINE, TAB, CR.

A small bug in csv_stringclean was fixed.  If the to_nuke was empty an invalid
regular expression was created.

* save a few string conversions.

* and a few more conversions saved.

* review comments incorporated in garmin_txt reader.

* fix minor bug accumulating badchars.

4 years agofix xcsv parse_style formatting. (#789)
tsteven4 [Sat, 11 Dec 2021 19:13:54 +0000 (12:13 -0700)]
fix xcsv parse_style formatting. (#789)

the blank line between the else and the if confused astyle.

4 years agosupport qt6 with cmake in windows build script. (#788)
tsteven4 [Fri, 10 Dec 2021 19:42:50 +0000 (12:42 -0700)]
support qt6 with cmake in windows build script. (#788)

4 years agoorganize source files in GPSBabel.pro, CMakeLists.text` (#787)
tsteven4 [Fri, 10 Dec 2021 17:26:36 +0000 (10:26 -0700)]
organize source files in GPSBabel.pro, CMakeLists.text` (#787)

* organize files in GPSBabel.pro and CMakeLists.tst

This makes it easier to compare the two, and easier to see what
changed when nuking things.

* fix for lack of continuation line

* update nuke_format for sources on their own lines.

delete MSVC project and solution files.  The project files should
be generated with "qmake -tp vc GPSBabel.pro".  MSVC will create
the solution file if needed.

4 years agoswitch gbfile supplemental plane test to nmea. (#786)
tsteven4 [Thu, 9 Dec 2021 22:36:54 +0000 (15:36 -0700)]
switch gbfile supplemental plane test to nmea. (#786)

4 years agoRemove compegps, cst, g7towin, gopal, gpsman, gpsutil, jogmap, jtr, maggeo, mapsend...
GPSBabel [Thu, 9 Dec 2021 21:36:24 +0000 (16:36 -0500)]
Remove compegps, cst, g7towin, gopal, gpsman, gpsutil, jogmap, jtr, maggeo, mapsend, nm4, pcx, pocketfms, skyforce, stmsdf, stmwpp, tiger, vpl, vidaone, vitosmt, vitovtt, wfff, and yahoo. (#785)

* Remove compegps, cst, g7to2in, gopal, gpsutil, jtr, maggeo, mapsend,
nm4, pcx, pocketfms, skyforce, stmsdf, stmwpp, tiger, vpl, wfff, and yahoo.

* Missing reference files from above.

* Change classic-3 test to read gzipped NMEA instead of deprecated formats.

* Drop gpsutil from tomtom test as it tested nothing unique.

* Remove gpsman test. It's a unicsv test and this tests nothing of value.

* Eliminate use of gpsutil in gpx test; it covered no unique paths.

* Update other GPSBabel.pro :-(

* Update Cmaeklists enough for successful Mac compile

* Cleanup internal doc references to newly retired formats.

* Scrub (and commit) the remaining doc changes for what we just deleted.

* Squashed commit of the following:

commit 40429dd3db113c30652e8e66b2a38237f1edbf39
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Mon Dec 6 16:37:53 2021 -0700

    fix dotnet time conversion (#784)

commit 54b013699f755b9a34f730c9f90729a2961b2704
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Mon Dec 6 07:13:44 2021 -0700

    Kill CarteSurTable format. (#783)

    Apparently it hasn't ever been used.  Our sample has coordinates in UTM,
    but we have been interpretting them as degrees/100000.  "Le pic du midi"
    referred to in the sample is The Pic du Midi de Bigorre.

commit 1ed58953b7a50c9a5e994e3d8d35055bef007fcd
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Sun Dec 5 15:30:05 2021 -0700

    harden gbfgetcstr, gbfgetpstr. (#782)

    Hangs were detected with afl and the gdb reader and gbfgetcstr.  One such
    hang reads a fuzzed 32 bit url count with FREAD_i32, and then proceeds
    to fetch that many strings with FREAD_CSTR_AS_QSTR.  This results in
    fetches from beyond EOF that are undetected.  gbfgetcstr_old is modified
    to throw a fatal error if reading is attempted beyond EOF.

    A similar failure was not detected with gbfgetpstr, but it is also
    modified to throw a fatal error if reading is attempted beyond EOF.

commit 85502cb3fd168287a24c5b14fa038cc0f02922eb
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Fri Dec 3 07:16:02 2021 -0700

    hopefully the real fix for garmin_xt tool issues. (#781)

    Fix LGTM detected "Comparison between i of type uint8_t and Count of
    wider type int."

    This latest find by LGTM is one in a long series of issue detections by
    various tools.  However, close analysis reveals the previous solutions
    to these deteced issues didn't find or fix the real root issues:

    commit 233f3c8b0bf69397403b6c1f29af8e10a65a8928, 10/22/2013, Pad
    internal buffer to appease -fsanitize=address.  While the fix appeased
    the sanitizer, it didn't fix the root problem.  The root problem was
    a bug in the original translation of format_garmin_xt_decrypt_trk_blk
    when converting to zero-based array indexing.

    commit dcf0dd85a71c6fa5fc3dac72520c2070ba051108, 7/8/2015, A bunch of
    busy work to satisfy hyperactive warnings in newer GCC builds.  Again,
    the fix didn't fix the root problem.  The root problem was a bug in the
    original translation of format_garmin_xt_proc_strk.  This bug resulted
    in a mismatch between our test output and that of the original project.
    In our output the timestamp of the last two points in a track was
    identical.

    This fix results in our output matching the reference file of the original
    project (with allowances for precision).

commit 727df5268184fb42a14963002cc77c5c9cf5d692
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Wed Dec 1 17:17:40 2021 -0700

    retire cet (#777)

    * teach mkshort to split utf8 on grapheme boundaries.

    and retire some cet functions.

    * add the grapheme test.

    * wean gbfile from cet.

    * restore cet.cc, cet.h in prepare for deprecation.

    * retire cet.cc, cet.h

    * drop attempted support of \r line endings in gbfgetutf16str.

    * add test of surrogate pairs for gbfgetutf16str.

    * fix test

commit 2371d119a57005dd7db23dfcfe576e7608074a67
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Wed Dec 1 13:11:33 2021 -0700

    add lgtm configuration file (#780)

commit 16820556e11349523ee7094dc9cd504515070a27
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Wed Dec 1 12:40:38 2021 -0700

    move Qt6 CI builds to 6.2.2. (#779)

commit d377ef65af27e5a0e48d8b4017cc76517e305dfc
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Wed Dec 1 06:26:08 2021 -0700

    convert arcdist, polygon, and xcsv to use gpsbabel::TextStream instead of gbfgetstr (#778)

    * read style files with a textstream.

    * use gpsbabel::textstream instead of gbfile.

commit f2da18dc2edba69639e51fbe3c7ef8ef161d8eea
Merge: 41cdf06b 23414450
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Tue Nov 30 15:46:26 2021 -0700

    Merge pull request #776 from tsteven4/nits3

    miscellaneous minor fixes III

commit 41cdf06b34975cbb1b2b1fb848002465803ce280
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Mon Nov 29 07:29:41 2021 -0700

    move Qt 5.12 CI builds to 5.12.12 (#774)

commit 2341445085d9f3c3b354c17f9f2527f5de673ee1
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Sun Nov 28 07:44:28 2021 -0700

    remove support for non standard entity replacements.

    This was disabled in d47e364f5 August 29, 2005.

commit dd56f42f5ce0a3ade1ce7b377a1da7a718f037ec
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Sat Nov 27 23:37:59 2021 -0700

    fix lgtm detected ill-defined for loop.

commit 59a325d14074bbd9abe32b165b1e10bbb5c69ffa
Merge: 56c86e2b 07694790
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Sat Nov 27 17:45:30 2021 -0700

    Merge pull request #772 from tsteven4/lgtm

    miscellaneous minor fixes

commit 0769479009f18e10eb131317710ded627db38482
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Fri Nov 26 14:42:42 2021 -0700

    sequester temporary style files in TMPDIR

commit 3f38cef6bcede6f58cd4e91fb796e84cc978dd5c
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Thu Nov 25 10:09:04 2021 -0700

    prefer rte_waypt_ct() over waypoint_list.count().

    this provides some insulation from the underlying WaypointList
    container.

commit bdd7865e7b4ee5ec1b61e94abd9ce63b4eb71aaf
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Thu Nov 25 08:37:57 2021 -0800

    sort SOURCES and HEADERS in build.

    this gives a reasonable initial project view in Xcode.
    this gives a resaonable order to compilation.

commit dd735b6e8443965d1e5cf47a4b83daf72fa4370c
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Wed Nov 24 11:11:15 2021 -0800

    minor correction to resample doc.

commit f7d3d60b1ac516061c73a05acb4f93b66def95c9
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Wed Nov 24 10:30:58 2021 -0800

    further minimize xcsv_get_char_from_constant_table

commit f483fc350f8aab14a54de7a71374c16f0988f000
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Wed Nov 24 09:51:14 2021 -0800

    use list initialization to construct xcsv char map table.

commit d62f479f0767cd545165ad1fcd1b734fe33eb1c2
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Wed Nov 24 08:52:22 2021 -0800

    more nits.

commit b2957b54db7d208183ab862990c06574a6c088c0
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Tue Nov 23 16:09:14 2021 -0800

    limit variable scope, found by LGTM.

    Poor global variable name 'ops'. Prefer longer, descriptive names for globals (eg. kMyGlobalConstant, not foo).

commit 56c86e2bc6ff0413da1057e144a3e899b320f8a8
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Tue Nov 23 09:40:30 2021 -0700

    fix parsing of nmea hms fields. (#770)

commit fa20976bcbedc72cd37100fa40c67a9d299b1b0e
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Sun Nov 21 14:04:55 2021 -0700

    Introduce resampling filter and nvectors. (#763)

    * Introduce resampling filter and nvectors.

    * use ellipsoid model with nvectors.

    the code had been forcing a spherical earth model to match the
    existing grtcirc.cc calculations.

commit 1a422a68320c6c5449bfee0f28a8da0a65697168
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Sun Nov 21 14:04:03 2021 -0700

    improve string handling, fix 9 year old FIXME. (#769)

commit e09f7fe5996073abf414b3bc2897c8dd84d2429a
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Sun Nov 21 13:34:23 2021 -0700

    support generation of xcode project files with qmake. (#760)

commit ff76e254a269c772da3cf7df94b1cab6b8dab1dc
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Sat Nov 20 08:05:01 2021 -0700

    update fit locations test with improved sample (#767)

    * update fit test with improved sample.

    * reference file mode correction.

commit 67ad13daaaf8d3dee5a1c7643d9c489ef7bc125d
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Fri Nov 19 06:48:53 2021 -0700

    Pick up fit locations test case (#766)

    * Add support for Locations.fit files

    * patch by tsteven4 to address review comments

    * Add a test case for Locations.fit files from Garmin devices

Co-authored-by: Fabrizio Gennari <fabrizio.ge@tiscali.it>
commit 368ad391c3a737058dec9fe82e3c33925add9027
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Thu Nov 18 16:40:49 2021 -0700

    add test for fit Locations(Lctns) files. (#765)

    * add test for fit Locations(Lctns) files.

    * fix new bug with change in Qt6 behavior for fit.

commit 871efe320b27bacecd7c98e9f7c0236b83ed9122
Author: fabzzap <fabrizio.ge@tiscali.it>
Date:   Thu Nov 18 22:07:59 2021 +0100

    Add support for Locations.fit files (#762)

    * Add support for Locations.fit files

    * patch by tsteven4 to address review comments

commit 2504d97daa490ddb4d0071e219fc4efbff98343a
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Wed Nov 17 08:52:08 2021 -0700

    Eliminiate redundant route_head data member (#764)

    eliminate redundant route_head data member rte_waypt_ct, replacing it with a member function rte_waypt_ct() that gets the count from the waypoint_list container.

commit 0beebdd5ecd9cadbb0219a5d9682a240a38a2170
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Mon Nov 8 05:22:30 2021 -0700

    kill xmap, xmap2006. (#758)

    * kill xmap, xmap2006.

    * dprecate obsolete readme.

commit 6593293ad8fee54764a9905064d4a647e553cd3f
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Fri Nov 5 15:13:05 2021 -0600

    kill xmapwpt. (#757)

    note is was wounded previously, see #754.

commit 7b6235ce627e9abac6c7ea34b9560935ad56483d
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Fri Nov 5 13:01:00 2021 -0600

    add fedora 35 to CI. (#756)

commit c3bc9c804ec84292f7a851ddbfba92f3c544e3ac
Author: tsteven4 <13596209+tsteven4@users.noreply.github.com>
Date:   Fri Nov 5 11:17:45 2021 -0600

    serial port names (#755)

    * try qserialportinfo again.

    * update docker images with qt serial port.

    * enhance windows device text to match device manager on windows.

* gbfile test can't depend on PCX any longer.\n Might be a hole in coverage.

* Remove vitosmt and vitovtt.

* Remove jogmap vidaone yahoo

* Remove gpsman.

* Remove more crumbs of g7towin.

* Run automated cleanup on the list of files in commit message to clean up last pieces.

* keep gpsutil.h in GPSBabel.pro

Co-authored-by: Robert Lipe <robertlipe@gmail.com>
4 years agoUpdate nuke_format so that it's safe (enough) to handle the bulk deletion
Robert Lipe [Thu, 9 Dec 2021 06:59:15 +0000 (01:59 -0500)]
Update nuke_format so that it's safe (enough) to handle the bulk deletion
to get rid of most of our older and unused formats. Some hand tuning may
still be needed

4 years agoAdd nuke_format, a tool to vaporize a format. Tested on yahoo and mapsend.
Robert Lipe [Wed, 8 Dec 2021 23:03:55 +0000 (18:03 -0500)]
Add nuke_format, a tool to vaporize a format. Tested on yahoo and mapsend.

4 years agofix dotnet time conversion (#784)
tsteven4 [Mon, 6 Dec 2021 23:37:53 +0000 (16:37 -0700)]
fix dotnet time conversion (#784)

4 years agoKill CarteSurTable format. (#783)
tsteven4 [Mon, 6 Dec 2021 14:13:44 +0000 (07:13 -0700)]
Kill CarteSurTable format. (#783)

Apparently it hasn't ever been used.  Our sample has coordinates in UTM,
but we have been interpretting them as degrees/100000.  "Le pic du midi"
referred to in the sample is The Pic du Midi de Bigorre.

4 years agoharden gbfgetcstr, gbfgetpstr. (#782)
tsteven4 [Sun, 5 Dec 2021 22:30:05 +0000 (15:30 -0700)]
harden gbfgetcstr, gbfgetpstr. (#782)

Hangs were detected with afl and the gdb reader and gbfgetcstr.  One such
hang reads a fuzzed 32 bit url count with FREAD_i32, and then proceeds
to fetch that many strings with FREAD_CSTR_AS_QSTR.  This results in
fetches from beyond EOF that are undetected.  gbfgetcstr_old is modified
to throw a fatal error if reading is attempted beyond EOF.

A similar failure was not detected with gbfgetpstr, but it is also
modified to throw a fatal error if reading is attempted beyond EOF.

4 years agohopefully the real fix for garmin_xt tool issues. (#781)
tsteven4 [Fri, 3 Dec 2021 14:16:02 +0000 (07:16 -0700)]
hopefully the real fix for garmin_xt tool issues. (#781)

Fix LGTM detected "Comparison between i of type uint8_t and Count of
wider type int."

This latest find by LGTM is one in a long series of issue detections by
various tools.  However, close analysis reveals the previous solutions
to these deteced issues didn't find or fix the real root issues:

commit 233f3c8b0bf69397403b6c1f29af8e10a65a8928, 10/22/2013, Pad
internal buffer to appease -fsanitize=address.  While the fix appeased
the sanitizer, it didn't fix the root problem.  The root problem was
a bug in the original translation of format_garmin_xt_decrypt_trk_blk
when converting to zero-based array indexing.

commit dcf0dd85a71c6fa5fc3dac72520c2070ba051108, 7/8/2015, A bunch of
busy work to satisfy hyperactive warnings in newer GCC builds.  Again,
the fix didn't fix the root problem.  The root problem was a bug in the
original translation of format_garmin_xt_proc_strk.  This bug resulted
in a mismatch between our test output and that of the original project.
In our output the timestamp of the last two points in a track was
identical.

This fix results in our output matching the reference file of the original
project (with allowances for precision).

4 years agoretire cet (#777)
tsteven4 [Thu, 2 Dec 2021 00:17:40 +0000 (17:17 -0700)]
retire cet (#777)

* teach mkshort to split utf8 on grapheme boundaries.

and retire some cet functions.

* add the grapheme test.

* wean gbfile from cet.

* restore cet.cc, cet.h in prepare for deprecation.

* retire cet.cc, cet.h

* drop attempted support of \r line endings in gbfgetutf16str.

* add test of surrogate pairs for gbfgetutf16str.

* fix test

4 years agoadd lgtm configuration file (#780)
tsteven4 [Wed, 1 Dec 2021 20:11:33 +0000 (13:11 -0700)]
add lgtm configuration file (#780)

4 years agomove Qt6 CI builds to 6.2.2. (#779)
tsteven4 [Wed, 1 Dec 2021 19:40:38 +0000 (12:40 -0700)]
move Qt6 CI builds to 6.2.2. (#779)

4 years agoconvert arcdist, polygon, and xcsv to use gpsbabel::TextStream instead of gbfgetstr...
tsteven4 [Wed, 1 Dec 2021 13:26:08 +0000 (06:26 -0700)]
convert arcdist, polygon, and xcsv to use gpsbabel::TextStream instead of gbfgetstr (#778)

* read style files with a textstream.

* use gpsbabel::textstream instead of gbfile.

4 years agoMerge pull request #776 from tsteven4/nits3
tsteven4 [Tue, 30 Nov 2021 22:46:26 +0000 (15:46 -0700)]
Merge pull request #776 from tsteven4/nits3

miscellaneous minor fixes III

4 years agomove Qt 5.12 CI builds to 5.12.12 (#774)
tsteven4 [Mon, 29 Nov 2021 14:29:41 +0000 (07:29 -0700)]
move Qt 5.12 CI builds to 5.12.12 (#774)

4 years agoremove support for non standard entity replacements.
tsteven4 [Sun, 28 Nov 2021 14:44:28 +0000 (07:44 -0700)]
remove support for non standard entity replacements.

This was disabled in d47e364f5 August 29, 2005.

4 years agofix lgtm detected ill-defined for loop.
tsteven4 [Sun, 28 Nov 2021 06:37:59 +0000 (23:37 -0700)]
fix lgtm detected ill-defined for loop.

4 years agoMerge pull request #772 from tsteven4/lgtm
tsteven4 [Sun, 28 Nov 2021 00:45:30 +0000 (17:45 -0700)]
Merge pull request #772 from tsteven4/lgtm

miscellaneous minor fixes

4 years agosequester temporary style files in TMPDIR
tsteven4 [Fri, 26 Nov 2021 21:42:42 +0000 (14:42 -0700)]
sequester temporary style files in TMPDIR

4 years agoprefer rte_waypt_ct() over waypoint_list.count().
tsteven4 [Thu, 25 Nov 2021 17:09:04 +0000 (10:09 -0700)]
prefer rte_waypt_ct() over waypoint_list.count().

this provides some insulation from the underlying WaypointList
container.

4 years agosort SOURCES and HEADERS in build.
tsteven4 [Thu, 25 Nov 2021 16:37:57 +0000 (08:37 -0800)]
sort SOURCES and HEADERS in build.

this gives a reasonable initial project view in Xcode.
this gives a resaonable order to compilation.

4 years agominor correction to resample doc.
tsteven4 [Wed, 24 Nov 2021 19:11:15 +0000 (11:11 -0800)]
minor correction to resample doc.

4 years agofurther minimize xcsv_get_char_from_constant_table
tsteven4 [Wed, 24 Nov 2021 18:30:58 +0000 (10:30 -0800)]
further minimize xcsv_get_char_from_constant_table

4 years agouse list initialization to construct xcsv char map table.
tsteven4 [Wed, 24 Nov 2021 17:51:14 +0000 (09:51 -0800)]
use list initialization to construct xcsv char map table.

4 years agomore nits.
tsteven4 [Wed, 24 Nov 2021 16:52:22 +0000 (08:52 -0800)]
more nits.

4 years agolimit variable scope, found by LGTM.
tsteven4 [Wed, 24 Nov 2021 00:09:14 +0000 (16:09 -0800)]
limit variable scope, found by LGTM.

Poor global variable name 'ops'. Prefer longer, descriptive names for globals (eg. kMyGlobalConstant, not foo).

4 years agofix parsing of nmea hms fields. (#770)
tsteven4 [Tue, 23 Nov 2021 16:40:30 +0000 (09:40 -0700)]
fix parsing of nmea hms fields. (#770)

4 years agoIntroduce resampling filter and nvectors. (#763)
tsteven4 [Sun, 21 Nov 2021 21:04:55 +0000 (14:04 -0700)]
Introduce resampling filter and nvectors. (#763)

* Introduce resampling filter and nvectors.

* use ellipsoid model with nvectors.

the code had been forcing a spherical earth model to match the
existing grtcirc.cc calculations.

4 years agoimprove string handling, fix 9 year old FIXME. (#769)
tsteven4 [Sun, 21 Nov 2021 21:04:03 +0000 (14:04 -0700)]
improve string handling, fix 9 year old FIXME. (#769)

4 years agosupport generation of xcode project files with qmake. (#760)
tsteven4 [Sun, 21 Nov 2021 20:34:23 +0000 (13:34 -0700)]
support generation of xcode project files with qmake. (#760)

4 years agoupdate fit locations test with improved sample (#767)
tsteven4 [Sat, 20 Nov 2021 15:05:01 +0000 (08:05 -0700)]
update fit locations test with improved sample (#767)

* update fit test with improved sample.

* reference file mode correction.

4 years agoPick up fit locations test case (#766)
tsteven4 [Fri, 19 Nov 2021 13:48:53 +0000 (06:48 -0700)]
Pick up fit locations test case (#766)

* Add support for Locations.fit files

* patch by tsteven4 to address review comments

* Add a test case for Locations.fit files from Garmin devices

Co-authored-by: Fabrizio Gennari <fabrizio.ge@tiscali.it>
4 years agoadd test for fit Locations(Lctns) files. (#765)
tsteven4 [Thu, 18 Nov 2021 23:40:49 +0000 (16:40 -0700)]
add test for fit Locations(Lctns) files. (#765)

* add test for fit Locations(Lctns) files.

* fix new bug with change in Qt6 behavior for fit.

4 years agoAdd support for Locations.fit files (#762)
fabzzap [Thu, 18 Nov 2021 21:07:59 +0000 (22:07 +0100)]
Add support for Locations.fit files (#762)

* Add support for Locations.fit files

* patch by tsteven4 to address review comments

4 years agoEliminiate redundant route_head data member (#764)
tsteven4 [Wed, 17 Nov 2021 15:52:08 +0000 (08:52 -0700)]
Eliminiate redundant route_head data member (#764)

eliminate redundant route_head data member rte_waypt_ct, replacing it with a member function rte_waypt_ct() that gets the count from the waypoint_list container.

4 years agokill xmap, xmap2006. (#758)
tsteven4 [Mon, 8 Nov 2021 12:22:30 +0000 (05:22 -0700)]
kill xmap, xmap2006. (#758)

* kill xmap, xmap2006.

* dprecate obsolete readme.

4 years agokill xmapwpt. (#757)
tsteven4 [Fri, 5 Nov 2021 21:13:05 +0000 (15:13 -0600)]
kill xmapwpt. (#757)

note is was wounded previously, see #754.

4 years agoadd fedora 35 to CI. (#756)
tsteven4 [Fri, 5 Nov 2021 19:01:00 +0000 (13:01 -0600)]
add fedora 35 to CI. (#756)

4 years agoserial port names (#755)
tsteven4 [Fri, 5 Nov 2021 17:17:45 +0000 (11:17 -0600)]
serial port names (#755)

* try qserialportinfo again.

* update docker images with qt serial port.

* enhance windows device text to match device manager on windows.

4 years agooptimize speed and distance conversions. (#753)
tsteven4 [Thu, 4 Nov 2021 14:02:09 +0000 (08:02 -0600)]
optimize speed and distance conversions. (#753)

* optimize speed and distance conversions.

structure constexpr conversions such that a minimal amount of
arithmetic is done at run time and avoiding run time division.

add tests for conversions.

* correct bug with display of accumulated path distance.

and add test case of same.

4 years agoretire TopoMapPro Places File format (#711)
tsteven4 [Tue, 2 Nov 2021 17:30:10 +0000 (11:30 -0600)]
retire TopoMapPro Places File format (#711)

* retire TopoMapPro Places File format.

* remove topomap pro reference files.

* catch serialization references up with tmpro retirement.

4 years agoupdate codacy badge.
tsteven4 [Mon, 1 Nov 2021 17:19:20 +0000 (11:19 -0600)]
update codacy badge.

4 years agoupdate Qt 5.12 builds on macos and windows to 5.12.11 (#752)
tsteven4 [Mon, 1 Nov 2021 16:21:24 +0000 (10:21 -0600)]
update Qt 5.12 builds on macos and windows to 5.12.11 (#752)

* update windows, macos Qt 5.12 builds to 5.12.11

* fool around with macos qt install path

* more fooling with macos qt path

* try macos qt path fix yet again

4 years agoEliminate internal copy/free inside navilink. (#751)
Robert Lipe [Mon, 1 Nov 2021 06:41:11 +0000 (01:41 -0500)]
Eliminate internal copy/free inside navilink. (#751)

* C++ improvements inside Vcard. Add test.
* Eternal impedance mismatch on C vs C++ pointer ownership.

4 years agoC++ improvements in VCard. Add tests. (#750)
Robert Lipe [Mon, 1 Nov 2021 05:49:57 +0000 (00:49 -0500)]
C++ improvements in VCard. Add tests. (#750)

* C++ improvements inside Vcard. Add test.
* Eternal impedance mismatch on C vs C++ pointer ownership.
* VCF: Incorporate review feedback: auote ','. Match HTML tage regardless of case.
* Quote commas in ASCII source, not just UTH8-encoded text.

4 years agoworkaround github cache output issues. (#749)
tsteven4 [Sat, 30 Oct 2021 14:14:11 +0000 (08:14 -0600)]
workaround github cache output issues. (#749)

a cache hit is reported only for an exact match.  But in a pull
request we can have an inexact match result in cache being fetched.

4 years agofix windows release with Qt6. (#748)
tsteven4 [Fri, 29 Oct 2021 00:24:00 +0000 (18:24 -0600)]
fix windows release with Qt6. (#748)

* fix windows release with Qt6.

windeployqt failed to deploy Qt6Core5Compat.dll because it was
not used by the gui and we didn't tell windeployqt there was
another executable to scan for dependencies.

* fiddle with github cache conditionals.

cache was restored, but we tried to install qt anyway.

* Revert "fiddle with github cache conditionals."

This reverts commit fece79e5e56de2f957960236bb851c6bc7682d7c.

* try to get github action conditionals working again.

* Revert "try to get github action conditionals working again."

This reverts commit 3152108e5267580f3836b9f6aadc7dfa2ecfe347.

* work around apparent bug in github action conditonal processing.

* the second half of the workaround

* fool around with bash

* more bash foolishness.

4 years agokill appveyor 5.9 build
tsteven4 [Wed, 27 Oct 2021 15:42:09 +0000 (09:42 -0600)]
kill appveyor 5.9 build

4 years agoupdate Qt6 builds to 6.2.1 (#747)
tsteven4 [Wed, 27 Oct 2021 13:43:25 +0000 (07:43 -0600)]
update Qt6 builds to 6.2.1 (#747)

4 years agoAdd support for Qt6. (#739)
tsteven4 [Tue, 26 Oct 2021 19:49:48 +0000 (13:49 -0600)]
Add support for Qt6. (#739)

* Add support for Qt6.

* fix a few codacy complaints.

4 years agoupdate fedora images dropping libusb versions before 1.0 (#746)
tsteven4 [Tue, 26 Oct 2021 19:06:17 +0000 (13:06 -0600)]
update fedora images dropping libusb versions before 1.0 (#746)

4 years agoupdate included libusb for mac to 1.0.24 (#744)
tsteven4 [Mon, 25 Oct 2021 11:26:34 +0000 (05:26 -0600)]
update included libusb for mac to 1.0.24 (#744)

4 years agoreplace the last uses of QRegExp. (#743)
tsteven4 [Mon, 25 Oct 2021 00:15:15 +0000 (18:15 -0600)]
replace the last uses of QRegExp. (#743)

also, correct the discard documentation.  The given example didn't
work in recent releases.

4 years agoupdate packages names in doc. (#745)
tsteven4 [Sat, 23 Oct 2021 20:18:29 +0000 (14:18 -0600)]
update packages names in doc. (#745)

4 years agoupdate document. (#741)
tsteven4 [Sat, 23 Oct 2021 18:51:48 +0000 (12:51 -0600)]
update document. (#741)

update build chapter to reflect current builds.
update dtd to 4.5.
correct manual page document syntax and missing items.

4 years agoobfuscate map key (#740)
tsteven4 [Wed, 20 Oct 2021 13:14:17 +0000 (07:14 -0600)]
obfuscate map key (#740)

* obfuscate map key.

* keep js debug turned off.

4 years agofix an out of bounds access to a QString in tpo. (#738)
tsteven4 [Fri, 15 Oct 2021 00:29:54 +0000 (18:29 -0600)]
fix an out of bounds access to a QString in tpo. (#738)

This was caught with Qt6.2.0, which has an assertion to check for
out of bounds access.
ASSERT: "i >= 0 && i < size()" in file .../Qt-6.2.0/6.2.0/gcc_64/include/QtCore/qstring.h, line 1325

4 years agotry harder to fix contious release tags. (#737)
tsteven4 [Thu, 14 Oct 2021 21:14:33 +0000 (15:14 -0600)]
try harder to fix contious release tags. (#737)

4 years agofix sha on continous releases from github. (#736)
tsteven4 [Thu, 14 Oct 2021 18:03:06 +0000 (12:03 -0600)]
fix sha on continous releases from github. (#736)

4 years agoMerge pull request #735 from tsteven4/pr643fixestry2
tsteven4 [Thu, 14 Oct 2021 14:57:45 +0000 (08:57 -0600)]
Merge pull request #735 from tsteven4/pr643fixestry2

tpo fixes for #643

4 years agouse constexpr for debug code in tpo.
tsteven4 [Thu, 14 Oct 2021 13:04:51 +0000 (07:04 -0600)]
use constexpr for debug code in tpo.

4 years agorun astyle on tpo.cc
tsteven4 [Thu, 14 Oct 2021 12:37:22 +0000 (06:37 -0600)]
run astyle on tpo.cc

4 years agofix codacy flagged %d in format string mismatch.
tsteven4 [Thu, 14 Oct 2021 12:36:25 +0000 (06:36 -0600)]
fix codacy flagged %d in format string mismatch.

%d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'.

4 years agoUpdate tpo.cc (#643)
SRE-babel [Wed, 13 Oct 2021 15:13:03 +0000 (08:13 -0700)]
Update tpo.cc (#643)

Some .tpo file tracks were/are parsed such that wild jumps occur in lat/lon, creating invalid coords which were not caught by output routines. Some logic flaws and int size errors have been fixed, but some tracks still contain invalid points. Tracks not corrected by this patch now result in warning messages to STDOUT. Entirely valid tracks will also generate warnings if lat or lon changes by a full degree between adjacent track points (should never happen). Non-fatal warning allows manual removal of the few bad track points  in an output format like GPX. Damage is apparently limited to half a dozen incremental points before the next full point, but that can't be guaranteed.

Co-authored-by: tsteven4 <13596209+tsteven4@users.noreply.github.com>
4 years agodon't set gpsbabel::XmlStreamWriter codec in mapfactor (#733)
tsteven4 [Wed, 13 Oct 2021 13:17:09 +0000 (07:17 -0600)]
don't set gpsbabel::XmlStreamWriter codec in mapfactor (#733)

We use utf-8 by default as of #671.

4 years agoMerge pull request #732 from tsteven4/qtprep103
tsteven4 [Tue, 12 Oct 2021 22:10:16 +0000 (16:10 -0600)]
Merge pull request #732 from tsteven4/qtprep103

Qt 6 compatiblity changes

4 years agoavoid std::min with QString::size
tsteven4 [Tue, 12 Oct 2021 21:20:35 +0000 (15:20 -0600)]
avoid std::min with QString::size

missed one in previous commit.

4 years agodon't include QCharRef.
tsteven4 [Tue, 12 Oct 2021 18:56:55 +0000 (12:56 -0600)]
don't include QCharRef.

missed one in previous commit.

4 years agoMerge pull request #731 from tsteven4/qt6prep102
tsteven4 [Tue, 12 Oct 2021 18:50:48 +0000 (12:50 -0600)]
Merge pull request #731 from tsteven4/qt6prep102

compatible changes for Qt6

4 years agodon't include QByteRef.
tsteven4 [Tue, 12 Oct 2021 17:54:03 +0000 (11:54 -0600)]
don't include QByteRef.

It is gone in Qt6.  It was not documented as a class in Qt5.
In Qt5 QByteRef just included qbytearray.h.

4 years agodon't include QCharRef.
tsteven4 [Tue, 12 Oct 2021 17:53:04 +0000 (11:53 -0600)]
don't include QCharRef.

It is gone in Qt6.  It was a "helper class for QString".  It was not
documented as a class in Qt5.  In Qt5 QCharRef just included qstring.h.

4 years agodon't include QStaticStringData.
tsteven4 [Tue, 12 Oct 2021 16:57:14 +0000 (10:57 -0600)]
don't include QStaticStringData.

missed one in the previous commit.

4 years agoMerge pull request #730 from tsteven4/qt6prep101
tsteven4 [Tue, 12 Oct 2021 16:00:21 +0000 (10:00 -0600)]
Merge pull request #730 from tsteven4/qt6prep101

compatible changes for Qt6

4 years agoaccomodate the deletion of QDateTime::toTime_t in Qt6.
tsteven4 [Tue, 12 Oct 2021 15:12:43 +0000 (09:12 -0600)]
accomodate the deletion of QDateTime::toTime_t in Qt6.

4 years agodon't include QStaticStringData.
tsteven4 [Tue, 12 Oct 2021 13:22:24 +0000 (07:22 -0600)]
don't include QStaticStringData.

It goes away in Qt6.  Besides, the documented include is QString,
which in Qt 5 will include qstringliteral.h just as QStaticStringData
does.

4 years agoavoid std::min with QString::size, which
tsteven4 [Tue, 12 Oct 2021 13:18:55 +0000 (07:18 -0600)]
avoid std::min with QString::size, which

changes types in Qt6.

4 years agomigrate from QRegExp to QRegularExpression. (#729)
tsteven4 [Sun, 10 Oct 2021 21:54:44 +0000 (15:54 -0600)]
migrate from QRegExp to QRegularExpression. (#729)

4 years agocompatible fixes for qt6 warnings and conflicts. (#728)
tsteven4 [Mon, 4 Oct 2021 19:17:19 +0000 (13:17 -0600)]
compatible fixes for qt6 warnings and conflicts. (#728)

* quite qt6 yammering about foreach.

* avoid name collision with Qt6.

* fix warning: type qualifiers ignored on cast result type

4 years agoDon't use Qt module names in include directives. (#727)
tsteven4 [Mon, 4 Oct 2021 17:21:42 +0000 (11:21 -0600)]
Don't use Qt module names in include directives. (#727)

This simplifies migration to Qt6 where some classes moved.

This was done mostly by an ed script, although mkstyle.sh took some
hand holding.

1,$g/#include <QtCore\// s/<QtCore\/\([^>]*\)>/<\1>       /
1,$g/#include <QtGui\// s/<QtGui\/\([^>]*\)>/<\1>      /
1,$g/#include <QtNetwork\// s/<QtNetwork\/\([^>]*\)>/<\1>          /
1,$g/#include <QtWidgets\// s/<QtWidgets\/\([^>]*\)>/<\1>          /
1,$g/ *$/ s/ *$//
w
q

4 years agomore qstringview work for qt6. (#726)
tsteven4 [Wed, 29 Sep 2021 15:46:00 +0000 (09:46 -0600)]
more qstringview work for qt6. (#726)

4 years agoupdate gui/gpx.cc to use QStringView for Qt6. (#725)
tsteven4 [Tue, 28 Sep 2021 12:22:36 +0000 (06:22 -0600)]
update gui/gpx.cc to use QStringView for Qt6. (#725)